<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>    
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
    <head>
    <link href="<c:url value="/resources/homepage.css" />" rel="stylesheet">
    
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Taskboard</title>
</head>
<body>
<div id="wrapper">
<form:form action="displayTask" method="post" modelAttribute="task">

<!-- ============ HEADER SECTION ============== -->
		<div id="header">
			<div id="headerlogo">
				</div>
		</div>
<!-- ============ NAVIGATION SECTION ============== -->
	<div id="menubar">
		
			<ul>
			<li><a href="Project">Projects</a></li>
					<li><a href="Backlog">Backlog</a></li>
					<li><a href="SprintPlanning">Sprint Planning</a></li>
					<li><a href="Storyboard1">Sprint Tracking</a></li>
					<li><a href="logout">Logout</a></li>
	</ul>
	</div>
<!-- ============ MIDDLE SECTION ============== -->
	<!--<div class="wrapper col5">	-->
  		
	<!--</div>-->
<!-- 	<div id="content"> -->
		<div id="main">
		<div id="projectitle">
			<h3>Taskboard</h3>
			</div>
	<!--	copy starts from here	-->

		<sql:setDataSource
				var="myDS"
				driver="com.mysql.jdbc.Driver"
				url="jdbc:mysql://localhost:3306/springct"
				user="root" 
				password="dhanashree"	/>
		
		<sql:query var="storyTitle"	dataSource="${myDS}">
					select story_title from story where story_id=<%=request.getParameter("story_id") %>;
		</sql:query>
			
		<c:forEach var="StoryTitle" items="${storyTitle.rows}">	
 		<h4>Story Title : ${StoryTitle.story_title}</h4>
 		</c:forEach>
		
      	<sql:query var="task"	dataSource="${myDS}">
					select task.task_id,task_title,task_owner,status.status_name from task,status,story where story.story_id = task.story_id and story.status_id = status.status_id and task.status_id = status.status_id and story.story_id=<%=request.getParameter("story_id")%>;
		</sql:query>
			
      <table>
          <tr>
	        <th>TASKS</th>
	        <th>OWNER</th>
            <th>STATUS</th>
		   </tr>
            <tr>
            <c:forEach var="task" items="${task.rows}">
				<tr>
					<td>
						<a href="Addtask1?task_id=${task.task_id}">
							<c:out value="${task.task_title}" /></a></td>
					<td><c:out value="${task.task_owner }" /></td>	
					<td><c:out value="${task.status_name}" /></td>
				</tr>
			</c:forEach>
          </tr>
		</table>
		</div>
		<div id="footer">
		<p>Copyright &copy; 2014 - All Rights Reserved - Spring CT</p>
		</div>
</form:form>
</div>
</body>
</html>